import 'package:flutter/material.dart';

/// 表格列表

class GridListApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    final String appTitle = 'Grid List Demo';
    return MaterialApp(
      title: appTitle,
      theme: ThemeData(primarySwatch: Colors.red),
      home: GridListAppPage(title: appTitle),
    );
  }
}

class GridListAppPage extends StatefulWidget {
  final String title;

  GridListAppPage({Key key, this.title}) : super(key: key);

  @override
  State<StatefulWidget> createState() => GridListAppPageState();
}

class GridListAppPageState extends State<GridListAppPage> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text(widget.title),
      ),
      body: GridView.count(
        crossAxisCount: 2,
        children: List.generate(100, (index) {
          return Center(
            child: Text(
              'Item $index',
              style: Theme.of(context).textTheme.headline,
            ),
          );
        }),
      ),
    );
  }
}
